package com.punch.common.enums.order;

/**
 * @author xiaol
 * @date 2020/7/21 15:53
 * 是否支持部分退款
 */

public enum PartRefundFlagEnum {

    NONE(0, "无退款"),

    PART_REFUND(1, "部分退款"),

    ALL_REFUND(2, "全部退款");

    PartRefundFlagEnum(int code, String name) {
        this.code = code;
        this.name = name;
    }

    private int code;
    private String name;

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }


    public static String getName(Integer code) {
        if (code == null) {
            return "";
        }
        for (PartRefundFlagEnum partRefundFlagEnum : PartRefundFlagEnum.values()) {
            if (partRefundFlagEnum.getCode() == code) {
                return partRefundFlagEnum.getName();
            }
        }
        return "";
    }
}

